<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>宠物百科</title>
    <link rel="stylesheet" href="css/wrap.css" media="screen" title="no title">
    <link rel="stylesheet" href="css/animate.css" media="screen" title="no title">
    <link rel="stylesheet" href="css/header.css" media="screen" title="no title">
    <link rel="stylesheet" href="css/cyclopedia.css" media="screen" title="no title">
    <link rel="stylesheet" href="css/footer.css" media="screen" title="no title">
    <script src="js/jquery-3.1.0.js" charset="utf-8"></script>
  </head>
  <body>
    <div class="header">
        <div class="head">
            <ul class="firstHead">
                <li><a href="index.html" target="_blank">波奇首页</a></li>
                <li><a href="shop.html" target="_blank">波奇商城</a></li>
                <li><a href="serve.html" target="_blank">波奇服务</a></li>
                <li><a href="message.html" target="_blank">波奇论坛</a></li>
                <li><a href="cyclopedia.html" target="_blank">宠物百科</a></li>
            </ul>
            <ul class="attention">
                <li><a href="#">关注我们<span><img src="" alt="" /></span></a></li>
                <li><a href="#">帮助中心</a></li>
                <li><a href="#"><span><img src="" alt="" /></span>收藏</a></li>
            </ul>
            <ul class="register">
                <li><a href="login.html" target="_blank">登陆</a></li>
                <li><a href="script:;">|</a></li>
                <li><a href="register.html" target="_blank">免费注册</a></li>
            </ul>
            <ul class="userLogin">
                <li>
                    <a href="script:;" id="userName"></a>
                </li>
                <li>|</li>
                <li><a href="script:;" id="quit">退出</a></li>
            </ul>

        </div>
    </div>
    <div class="navigation">
      <div class="logo">
        <img src="source/images/logo_baike.gif" alt="" />
      </div>
      <div class="serch">
          <input id="keyword" type="text" name="name" value="" placeholder="请输入关键字">
          <img id="search" src="source/images/ind_sch.png" alt="" />
      </div>
      <div class="app">
        <a href="#"><img src="source/images/app.jpeg" alt="" /></a>
      </div>
    </div>
    <div class="nav">
      <ul>
        <li><a href="cyclopedia.html">首页</a></li>
        <li><a href="#dog">狗狗</a></li>
        <li><a href="#cat">猫咪</a></li>
        <li><a href="#other">小宠爬虫水族</a></li>
        <!-- <li><a href="#">水族</a></li>
        <li><a href="#">爬虫</a></li> -->
      </ul>
    </div>
    <div class="content">
        <div class="top">
          <div class="wrap">
            <div class="rotate">
              <a href="script:;"><img src="source/images/img/rotate_01.jpg" alt="" /></a>
              <a href="script:;"><img src="source/images/img/rotate_02.jpg" alt="" /></a>
              <a href="script:;"><img src="source/images/img/rotate_03.jpg" alt="" /></a>
              <a href="script:;"><img src="source/images/img/rotate_04.jpg" alt="" /></a>
              <a href="script:;"><img src="source/images/img/rotate_05.jpg" alt="" /></a>
            </div>
            <div class="box">
              <span></span>
              <span></span>
              <span></span>
              <span></span>
              <span></span>
            </div>
            <div class="message">
              <span><a href="#"><bt>宠物夏季饲养全攻略</bt><br>夏天对于各种宠物来说是一个无比难熬的季节。
                但是主人们请不要担心，我们来给大家支支招，学习一点消夏小...</a></span>
              <span><a href="#"><bt>肥胖是一种忧郁——宠物减肥妙招学起来</bt><br>炎炎夏日，谁最忧伤？当然
                是苦逼的胖子们，一身的脂肪还要备受高温的煎熬。如今宠物发胖的趋势也不容小觑，要知道肥胖不仅难耐...</a></span>
              <span><a href="#"><bt>爱猫无国界：各国猫文化大盘点</bt><br>一方水土养一方猫，想不想在日本繁
                华的猫街沾沾招财猫的福气？或是在雨后的浪漫法兰西和你心中那只喵来场旷世绝恋？快上
                车...</a></span>
              <span><a href="#"><bt>干货分享——养犬新手必看知识合集</bt><br>初养宠物犬，更多的新手饲主有
                着的是一种迷茫。因为狗狗是花了大价钱买来的，所以对待起来也不可能那么的随便。九层
                之台、起于累...</a></span>
              <span><a href="#"><bt>你说我像饼？偶可是热带鱼之王七彩神仙！</bt><br>七彩神仙鱼的辨识度很高，
                远远看去像块铁饼的就是了。七彩神仙可不是一般的观赏鱼，它是大名鼎鼎的热带鱼之王！！</a></span>
            </div>
          </div>
          <div class="right">
            <div class="box">
              <a href="page1.html">宠物大全<br><bt>在这里，我们用相知与它结缘</bt></a></span>
            </div>
            <div class="box">
              <a href="pet.html?1">宠物饲养<br><bt>在这里，我们用安全伴它成长</bt></a></span>
            </div>
            <div class="box">
              <a href="pet.html?2">宠物训练<br><bt>在这里，我们用鼓励陪它同行</bt></a></span>
            </div>
            <div class="box">
              <a href="pet.html?3">宠物医疗<br><bt>在这里，我们用呵护保它健康</bt></a></span>
            </div>
          </div>
        </div>
        <div class="hot">
          <div class="hot_head">
            <span>热门宠物</span>
            <span><a href="page1.html">更多 »</a></span>
          </div>

        </div>
        <div class="dog" id="dog">
          <div class="dog_head">
            <img src="source/images/img/dog_head.png" alt="" /><span class="title">
              狗狗百科
            </span>
            <div class="other">
              <span><a href="#">狗狗饲养</a></span>
              <span>|</span>
              <span><a href="#">狗狗训练</a></span>
              <span>|</span>
              <span><a href="#">狗狗医疗</a></span>
            </div>
          </div>
          <div class="problem">
            <div class="problem_left" >
              <img id="dogimg" src="" alt="" />
              <p id="dogtitle" class="p1">

              </p>
              <div class="answer">
                <p>
                  为狗狗做好驱虫工作不只是为了防止某些寄生虫对我们的健康造成影响，
                  更主要的是因为寄生虫对于狗狗的危害来的更大，而且寄生虫不...
                  [<a href="#" id="doghref">详细</a>]
                </p>
              </div>
            </div>
            <div class="problem_middle" id="dogs">

            </div>
            <div class="problem_right">
              <span><a href="#">狗狗支气管治疗时要注意什么？</a></span>
              <span><a href="#">狗狗支气管肺炎的症状是什么？</a></span>
              <span><a href="#">犬瘟如何预防？</a></span>
              <span><a href="#">犬瘟热的症状有那些？</a></span>
              <span><a href="#">如何检测狗狗有没有犬瘟？</a></span>
              <span><a href="#">犬瘟的传播途径有那些？</a></span>
              <span><a href="#">狗狗细小怎么用中医治？</a></span>
              <span><a href="#">什么是狗狗细小的特异疗法？</a></span>
              <span><a href="#">狗狗细小的治疗原则是什么？</a></span>
              <span><a href="#">如何区分细小和狗狗感冒？</a></span>
            </div>
          </div>
        </div>
        <div class="dog" id="cat">
          <div class="dog_head">
            <img src="source/images/img/cat_head.png" alt="" /><span class="title">
              猫咪百科
            </span>
            <div class="other">
              <span><a href="#">猫咪饲养</a></span>
              <span>|</span>
              <span><a href="#">猫咪训练</a></span>
              <span>|</span>
              <span><a href="#">猫咪医疗</a></span>
            </div>
          </div>
          <div class="problem">
            <div class="problem_left">
              <img id="catimg" src="" alt="" />
              <p id="cattitle" class="p1">

              </p>
              <div class="answer">
                <p>
                  猫出现了病症，对于猫病症的检查方法有许多种，可分为全身检查，被毛和皮肤检查，
                  可视粘膜的检查等等，其中各个部位的检查方法也...
                  [<a href="#" id="cathref">详细</a>]
                </p>
              </div>
            </div>
            <div class="problem_middle" id="cats">

            </div>
            <div class="problem_right">
              <span><a href="#">猫咪肋骨侧方发现皮下活动瘤子...</a></span>
              <span><a href="#">猫咪什么时候绝育最好？</a></span>
              <span><a href="#">猫咪绝育有风险吗？</a></span>
              <span><a href="#">给猫咪绝育有什么好处吗？</a></span>
              <span><a href="#">如何为我的母猫选择公猫？</a></span>
              <span><a href="#">怎么判断我家猫咪是不是怀孕了？</a></span>
              <span><a href="#">猫咪怀孕后该怎么照顾？</a></span>
              <span><a href="#">猫咪为什么会难产？</a></span>
              <span><a href="#">我家猫咪难产了该怎么办？</a></span>
              <span><a href="#">如何让两只猫咪顺利交配？</a></span>
            </div>
          </div>
        </div>
        <div class="dog" id="other">
          <div class="dog_head">
            <img src="source/images/img/37.png" alt="" /><span class="title">
              小虫爬虫水族
            </span>
            <div class="other">
              <span><a href="#">仓鼠/龙猫</a></span>
              <span>|</span>
              <span><a href="#">兔子</a></span>
              <span>|</span>
              <span><a href="#">热带龟</a></span>
              <span>|</span>
              <span><a href="#">陆龟</a></span>
              <span>|</span>
              <span><a href="#">水龟</a></span>
              <span>|</span>
              <span><a href="page1.html">更多 »</a></span>
            </div>
          </div>
          <div class="problem" style="border-bottom:1px solid gray;padding-bottom:30px" >
            <div class="problem_left">
              <img id="reptileimg"src="" alt="" />
              <p id="reptiletitle"class="p1">

              </p>
              <div class="answer" >
                <p >
                  兔异食症的发生除了与平时的习惯有关之外，主要还是因为身体缺乏某些微量元素所造成的。
                  患有异食症的家兔会对原本很多本能进食的...
                  [<a href="#" id="reptilehref">详细</a>]
                </p>
              </div>
            </div>
            <div class="problem_middle" id="reptiles" >

            </div>
            <div class="problem_right">
              <span><a href="#">剃刀龟后肢肿块</a></span>
              <span><a href="#">4到6月的雄虎皮鹦鹉适合交配吗？</a></span>
              <span><a href="#">中华草龟龟苗，这是什么症状？...</a></span>
              <span><a href="#">三线鼠不吃东西</a></span>
              <span><a href="#">小兔子能训练吗？能的话告诉我</a></span>
              <span><a href="#">关于兔兔</a></span>
              <span><a href="#">这是肿么了</a></span>
              <span><a href="#">急急急</a></span>
              <span><a href="#">仓鼠可以同笼吗</a></span>
              <span><a href="#">迷你辣椒蟹</a></span>
            </div>
          </div>
        </div>

    </div>
    <div class="footer">
       <ul>
         <li><a href="#">关于我们</a></li>|
         <li><a href="#">友情链接</a></li>|
         <li><a href="#">诚聘英才</a></li>|
         <li><a href="#">联系我们</a></li>|
         <li><a href="#">网站地图</a></li>|
         <li><a href="#">意见反馈</a></li>|
         <li><a href="#">帮助中心</a></li>|
         <li><a href="#">客服热线：123456789</a></li>
       </ul>
       <p>
         Copyright © 2007-2016 Boqii.com All Rights Reserved 光橙（上海）信息科技有限公司 版权所有 沪ICP备13034501号-2 增值电信业务经营许可证：沪B2-20140120
       </p>
       <p class="href">
          <a href="http://www.sgs.gov.cn/"><img src="source/images/foot_gs.png" alt="" /></a>
          <a href="#"><img src="source/images/foot_cx.png" alt="" /></a>
          <a href="#"><img src="source/images/foot_kx.png" alt="" /></a>
          <a href="#"><img src="source/images/foot_zx.png" alt="" /></a>
       </p>
    </div>
  </body>
</html>
<script src="js/rotate.js" charset="utf-8"></script>
<script type="text/javascript">

var register = document.getElementsByClassName("register")[0];
var userLogin =document.getElementsByClassName("userLogin")[0];
var userName = document.getElementById("userName");
var quit = document.getElementById("quit");
window.ready = readStorage();
setInterval(readStorage,2000);
//读取storage的数据
function readStorage(){
  var storage = window.localStorage;
  if (typeof(storage["user"])=='undefined') {
    register.style.display ="inline-block";
    userLogin.style.display = "none";
     return false;
  }else if(storage["user"]==""){
    register.style.display ="inline-block";
    userLogin.style.display = "none";
     return false;
  }else {
    var myDate =  new Date();
    var currenTime = myDate.getTime();
    if (currenTime >= Number(storage["userTime"])+3600000) {
      storage["user"] =="";
    }else {
        register.style.display ="none";
        userLogin.style.display = "inline-block";
        userName.innerText = storage["user"];
    }

  }
}
quit.onclick = function (){
  var storage = window.localStorage;
  register.style.display ="inline-block";
  userLogin.style.display = "none";
  storage["user"] = "";
}

if (window.ActiveXObject) {
  XMLHttp = new ActiveXObject('Microsoft.XMLHTTP');
}else{
  XMLHttp = new XMLHttpRequest();
}
var url = "php/animalList.php";
  console.log(url);
  var area = 0;
XMLHttp.open('get',url,true);
XMLHttp.send(null);
XMLHttp.onreadystatechange = function () {
  if (XMLHttp.readyState == 4) {
    if (XMLHttp.status == 200) {
      obj = JSON.parse(XMLHttp.response);
      switch (area) {
        case 0:
          var name = document.getElementsByClassName("name");
          var img = document.getElementsByClassName("img");
          for (var i = 0; i < 12; i++) {
            var objbody = JSON.parse(obj[i]);
            var pet = document.createElement("div");
            pet.className = "pet";
            pet.innerHTML= '<a href="animalShow.html?'+objbody.name+'"><img src="'+objbody.imgurl1+'" alt="" /></a><div class="name"><a href="animalShow.html?'+objbody.name+'">'+objbody.name+'</a></div>'
            var hot = document.getElementsByClassName("hot")[0];
            hot.appendChild(pet);
          }
          area++;
          url = "php/articlekind.php?kind1="+area;
          console.log(url);
          XMLHttp.open('get',url,true);
          XMLHttp.send(null);
          break;
        case 1:
          for (var i = 0; i < 9; i++) {
            var objbody = JSON.parse(obj[i]);
            if (i==0) {
              var doghref = document.getElementById("doghref");
              doghref.href = "article.html?"+objbody.title;
              var dogimg = document.getElementById("dogimg");
              dogimg.src = objbody.imgurl2;
              var dogtitle = document.getElementById("dogtitle");
              dogtitle.innerText = objbody.title;
            }else{
            var box = document.createElement("div");
            box.className = "box";
            box.innerHTML= '<a href="article.html?'+objbody.title+'"><img src="'+objbody.imgurl2+'" alt="" /></a><span><a href="article.html?'+objbody.title+'">'+objbody.title+'</a></span>'
            var dogs = document.getElementById('dogs');
            dogs.appendChild(box);
            }
          }
          area++;
          url = "php/articlekind.php?kind1="+area;
          XMLHttp.open('get',url,true);
          XMLHttp.send(null);
          break;
        case 2:
          for (var i = 0; i < 9; i++) {
            var objbody = JSON.parse(obj[i]);
            if (i==0) {
              var cathref = document.getElementById("cathref");
              cathref.href = "article.html?"+objbody.title;
              var catimg = document.getElementById("catimg");
              catimg.src = objbody.imgurl2;
              var cattitle = document.getElementById("cattitle");
              cattitle.innerText = objbody.title;
            }else{
            var box = document.createElement("div");
            box.className = "box";
            box.innerHTML= '<a href="article.html?'+objbody.title+'"><img src="'+objbody.imgurl2+'" alt="" /></a><span><a href="article.html?'+objbody.title+'">'+objbody.title+'</a></span>'
            var cats = document.getElementById('cats');
            cats.appendChild(box);
            }
          }
          area++;
          url = "php/articlekind.php?kind1="+area;
          console.log(url);
          XMLHttp.open('get',url,true);
          XMLHttp.send(null);
          break;
        case 3:
          for (var i = 0; i < 9; i++) {
              var objbody = JSON.parse(obj[i]);
            if (i==0) {
              var reptilehref = document.getElementById("reptilehref");
              reptilehref.href = "article.html?"+objbody.title;
              console.log(reptilehref.href);
              var reptileimg = document.getElementById("reptileimg");
              reptileimg.src = objbody.imgurl2;
              var reptiletitle = document.getElementById("reptiletitle");
              reptiletitle.innerText = objbody.title;
            }else{
            var box = document.createElement("div");
            box.className = "box";
            box.innerHTML= '<a href="article.html?'+objbody.title+'"><img src="'+objbody.imgurl2+'" alt="" /></a><span><a href="article.html?'+objbody.title+'">'+objbody.title+'</a></span>'
            var reptiles = document.getElementById('reptiles');
            reptiles.appendChild(box);
            }
          }
          break;

          default:
          console.log(222);
            break;

      }

    }
  }
}

var keyword = document.getElementById("keyword");
var search = document.getElementById("search");
search.onclick = function () {
  if (!keyword.value) {
    keyword.focus();
  }else{
    window.open('wares.html?'+keyword.value);
  }
}
</script>
